/*
 * Copyright ©
 * #  递归组件
 * @author: zw
 * @date: 2021-09-04 
 */


import { defineComponent } from 'vue'
export default defineComponent({
  name: 'ReSubMenu',
  props: { data: { type: Object, required: true } },
  setup(props, { emit, slots }) {
    return () => {
      const { data } = props;
      return (
        <SubMenuItem v-slots={{ title: () => data.title }}>
          {
            data.children.map(item =>
              !item.children ? <menu-item>{item.title}</menu-item> : <re-sub-menu data={item}></re-sub-menu>
            )
          }
        </SubMenuItem>
      )
    }
  }
})
